package com.keshan.mapper;

import com.keshan.pojo.UserDevice;
import com.keshan.pojo.UserDeviceExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface UserDeviceMapper {
    int countByExample(UserDeviceExample example);

    int deleteByExample(UserDeviceExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(UserDevice record);

    /**
     * @author tangzheng
     * @date 2023/2/10 18:43
     * @description 通用插入方法
     * @param userDevice entity
     */
    void insertSelective(UserDevice userDevice);

    List<UserDevice> selectByExample(UserDeviceExample example);

    UserDevice selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") UserDevice record, @Param("example") UserDeviceExample example);

    int updateByExample(@Param("record") UserDevice record, @Param("example") UserDeviceExample example);

    int updateByPrimaryKeySelective(UserDevice record);

    int updateByPrimaryKey(UserDevice record);

    /**
     * @author tangzheng
     * @date 2023/2/10 18:32
     * @description 对应设备号是否已被绑定
     * @param imei 设备号
     * @return boolean
     */
    Integer isExistByImei(String imei);

    /**
     * @author tangzheng
     * @date 2023/2/10 18:32
     * @description 用户是否已经绑定相同类型的设备
     * @param userDevice 设备类型与用户名
     * @return boolean
     */
    Integer isExitsByTypeAndUser(UserDevice userDevice);

    /**
     * @param userDevice 设备号和设备类型和用户名
     * @author tangzheng
     * @date 2023/2/10 18:40
     * @description 用户解绑设备
     */
    void deleteSelective(UserDevice userDevice);
}
